#include "colorcontrollerbox.h"


ColorControllerBox::ColorControllerBox(SageVis *svp, QGraphicsItem *parent) :
    VisBaseWidget(svp, parent)
{
//    mainLayout = new QGraphicsGridLayout(this); //new QGraphicsLinearLayout(this);

//    textEdit1 = new QLineEdit;
//    textEdit2 = new QLineEdit;
//    textEdit3 = new QLineEdit;

//    textEditLayoutItem1 = new QGraphicsLayoutItem(this);
//    textEditLayoutItem2 = new QGraphicsLayoutItem(this);
//    textEditLayoutItem3 = new QGraphicsLayoutItem(this);

//    textEditProxy1 = new QGraphicsProxyWidget( this, Qt::Widget);
//    textEditProxy2 = new QGraphicsProxyWidget( this, Qt::Widget);
//    textEditProxy3 = new QGraphicsProxyWidget( this, Qt::Widget);

//    textEditProxy1->setWidget( textEdit1 );
//    textEditProxy2->setWidget( textEdit2 );
//    textEditProxy3->setWidget( textEdit3 );

//    textEditLayoutItem1->setGraphicsItem( textEditProxy1 );

//    mainLayout->addItem( textEditLayoutItem1, 0, 0 );
//    mainLayout->addItem( textEditProxy2, 1, 0 );
//    mainLayout->addItem( textEditProxy3, 2, 0 );

//    mainLayout->setContentsMargins(0,0,0,0);

//    this->setLayout( mainLayout );

}

ColorControllerBox::~ColorControllerBox()
{

}

QRectF ColorControllerBox::boundingRect() const
{
    return QRectF( -200, -200, 400, 400); //QRectF r ( -400, -375, 1050, 750);

}

QPainterPath ColorControllerBox::shape() const
{
    QPainterPath path;
    path.addRect(boundingRect());
    return path;
}


void ColorControllerBox::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
{
    QColor background(50, 50, 50, 255 );
    painter->setBrush(background);

    QRectF bRect = boundingRect();
    bRect.adjust(1, 1, -1, -1);
    painter->drawRect(bRect);
}
